home *** CD-ROM | disk | FTP | other *** search
- samples.jar
-
- The file contains following JProxy examples:
-
- 1. Statefull Session Bean example.
- package: com.jproxy.samples.ejb.test
-
- 2. RMI Example
- package: com.jproxy.samples.rmi.test
-
-
- For simplicity reason samples.jar may be used for both client and server.
- It contains source code and classes.
-
- You may simply unzip samples.jar.
-
- 1. EJB Example
- To execute EJB client type from command prompt:
- java -cp samples.jar;proxyclient.jar;j2api.jar com.jproxy.samples.ejb.test.SessionClient Protocol://your_server_name:port
-
- Where:
- Protocol - "http" or "https". Default is "http"
-
- YuorServerName - name of the host where your EJB Server is running.
- If it is local then just use "localhost".
- Default is "localhost".
-
- Port - port of your Web Server (Servlet Engine) where JProxy deployed.
- Default is 80.
-
- If your client is local and uses http protocol with default port (80)
- then you do not need to specyfy server URL
-
- To use "https" protocol you have to enable SSL on your server.
-
- The sample bean and client have been successfully tested on JBoss, WebLogic, Orion and JONAS Application Servers.
-
-
- 2. RMI Example
- First you have to start RMI TestServer object:
-
- rmic has been used to produce stub and skeleton.
-
- Here are command lines to start server and client:
-
- In this example TestServer uses JBoss Naming Service to bind the object.
- JBoss clients JNDI library is jnp-client.jar.
- To use different Application Server use apropriate libraries for Naming Service.
-
- Server:
- java -cp samples.jar;proxyclient.jar; -Djava.naming.factory.initial=com.jproxy.proxy.NamingContextFactory -Djava.naming.provider.url=localhost:8080 -Djava.rmi.server.codebase=file://samples.jar com.jproxy.samples.rmi.test.TestServer
- Notice "-D" parameter. The parameter assumes that TestServer starts from directory where samples.jar is.
-
- Client:
- java -cp samples.jar;proxyclient.jar; -Djava.naming.factory.initial=com.jproxy.proxy.NamingContextFactory -Djava.naming.provider.url=localhost:8080 com.jproxy.samples.rmi.test.TestClient
-